//
//  CoachsBookTableHeaderCell.m
//  CoachsBook
//
//  Created by huiyong li on 2022/8/20.
//

#import "CoachsBookTableHeaderCell.h"
@interface CoachsBookTableHeaderCell ()
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIView *lineView;

@end

@implementation CoachsBookTableHeaderCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier])
    {
        [self setViews];
        self.contentView.backgroundColor = [UIColor whiteColor];
    }
    return self;
}

- (void)setViews
{
    self.lineView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, APPwidth, 10)];
    self.lineView.backgroundColor = rgba(245, 245, 250, 1);
    

    UIView *HeaderV = [[UIView alloc]initWithFrame:CGRectMake(0, 10, APPwidth, 45)];
    HeaderV.backgroundColor = [UIColor whiteColor];
    UIView *myDataLineV = [[UIView alloc]initWithFrame:CGRectMake(15, 15, 3, 15)];
    myDataLineV.backgroundColor = rgba(22, 120, 255, 1);
    myDataLineV.layer.cornerRadius = 2;
    [HeaderV addSubview:myDataLineV];
    self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(myDataLineV.frame)+5, 15, 150, 15)];
    self.titleLabel.textColor = [UIColor blackColor];
    self.titleLabel.textAlignment = 0;
    self.titleLabel.font = [UIFont systemFontOfSize:16 weight:bold];
    [HeaderV addSubview:self.titleLabel];
    [self.contentView addSubview:self.lineView];
    [self.contentView addSubview:HeaderV];
    
}

-(void)cellFillWithModel:(CoachsBookInputModel *)model
{
    self.titleLabel.text = model.title;
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
